<template>
	<view class="bg">
		<view class="bg1"></view>
		<view class="head">
			<view class="left">
				<image :src="user.technician_avatar" class="ava"></image>
			</view>
			<view class="rig">
				<view class="g1">
					<view class="name">{{user.technician_username}}</view>
					<u-icon name="man" label="女" color="#f10e0e" v-if="user.technician_gender == '女'"></u-icon>
					<u-icon name="woman" label="男" color="#0081ff" v-else></u-icon>
				</view>
				<view class="g2">
					<view class="str">{{
						user.self_introduction
					}}</view>
				</view>
			</view>
		</view>
		
		<view class="center">
			<view class="main">
				<view class="tit">基本信息</view>
				<view class="desc">
					<text>意向工作城市</text>
					<text class="city">{{user.technician_city}}</text>
				</view>
				<view class="jian">技师简介</view>
				<view class="desc">
					{{user.work_experience}}
				</view>
				<view class="jian">特长</view>
				<view class="desc">
					{{user.specialties}}
				</view>
			</view>
		</view>
		
		<view class="mar">
			<view class="main">
				<view class="tit">资质证书</view>
				<view class="desc">
					<image :src="item" v-for="(item,index) in user.certificate" class="img" @click="viImg(index,1)"></image>
				</view>
			</view>
		</view>
		
		<view class="mar">
			<view class="main">
				<view class="tit">生活照</view>
				<view class="desc">
					<image :src="item" v-for="(item,index) in user.life_photos" class="img" @click="viImg(index,2)"></image>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{}
			}
		},
		onLoad(e) {
			this.user_id = e.uid
			this.getinit();
		},
		methods: {
			viImg(current,type){
				let that = this
				if(type == 1){
					uni.previewImage({
						urls: that.user.certificate,
						current: current,
						indicator: 'default',
						loop: true,
						fail(err) {
							
						},
					})
				}else{
					uni.previewImage({
						urls: that.user.life_photos,
						current: current,
						indicator: 'default',
						loop: true,
						fail(err) {
							
						},
					})
				}
			},
			getinit(){
				let that = this;
				that.$http('technician.getTechnicianInfoDetail', {uid:that.user_id}, '获取中...').then(res => {
					that.user = res.data 
				})
			}
		}	
	}			
</script>

<style>
	.bg {
		
	}
	.head {
		background: white;
		    display: flex;
		    margin-top: 20px;
		    position: absolute;
		    width: 94%;
		    margin: auto;
		    left: 0;
		    right: 0;
		    top: 30px;
		    border-radius: 5px;
		    padding: 8px;
			height: 85px;
	}
	.g1 {
		display: flex;
		    justify-content: space-between;
			width: 100px;
	}
	.left {
		width: 23%;
		    margin-right: 15px;
	}
	.ava {
		border-radius: 50%;
		    width: 75px;
		    height: 75px;
		    position: absolute;
		    top: -15px;
		    left: 16px;
		}
	.bg1 {
		background: #39b54a;
		height: 70px;
	}
	.g1 {
		display: flex;
		justify-content: space-between;
	}
	.name {
		font-weight: 600;
	}
	.str {
		font-size: 12px;
		margin-top: 8px
	}
	.center {
		margin-top: 60px;
		
	}
	.main {
		background: white;
		margin: auto;
		width: 94%;
		background: white;
		padding: 15px;
		border-radius: 5px;
	}
	.tit {
		margin-bottom: 15px;
		    font-weight: 600;
	}
	.desc {
		margin-bottom: 15px
	}
	.mar {
		margin-top: 20px
	}
	.city {
		margin-left: 15px;
	}
	.jian {
		font-weight: 600;
		margin-bottom: 15px;
	}
	.rig {
		width: 70%;
	}
</style>